<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name,age,sex) {
            this.name = name;
            this.age = age;
            this.sex = sex;
            this.sayHi = function () {
                console.log('构造函数你好');
            }
            // 经过new关键字后，this才指向自已
        }
        function Person(name,age,sex) {
            this.name = name;
            this.age = age;
            this.sex = sex;
            this.sayHi =function () {
                console.log('构造函数你好');
            }
        }
        Function Person(name, age, sex) {
            this.name = name;
            this.age = age;
            this.sex = sex;
            this.sayHi = function () {
                console.log('构造函数你好')
            }
        } 
        Person();
        // Person.prototype.sayHi = function () {
        //     console.log('原型上的你好');
        // }
        var yq1 = new Person('刘敏1',18,'女');
        var yq2 = new Person('刘敏2',18,'女');
        var yq3 = new Person('刘敏3',18,'女');
        var yq4 = new Person('刘敏4',18,'女');
        // var cs = new Person('叶建新',18,'男');

        // yq.sayHi();
    </script>
</body>
</html>